//
//  AXFCreditsVC.m
//  BEEQUICK
//
//  Created by admin on 21/11/2016.
//  Copyright © 2016 SevenGroup. All rights reserved.
//

#import "AXFCreditsVC.h"
#import "AXFCircleAniView.h"
#import "AXFHomeController.h"
#import "AXFWhiteNavView.h"

@interface AXFCreditsVC ()<AXFWhiteNavViewDelegate>

@end

@implementation AXFCreditsVC

- (void)setupUI {
	self.navigationItem.title = @"积分";
	
//	self.navigationController.navigationBar.hidden = NO;
	
	AXFCircleAniView *circleView = [[AXFCircleAniView alloc] initWithFrame:CGRectMake(0, 64, kSCREENWIDTH, 183)];
	UIView *bottomView = [[UIView alloc] init];
	UIImageView *creditsImgView = [[UIImageView alloc] init];
	UILabel *infoLabel = [UILabel lr_labelWithText:@"还没有积分哦, 赶快取购物吧~" fontSize:15 color:0xa4a4a4];
	UIButton *goShoppintBtn = [[UIButton alloc] init];
	
	circleView.progress = 1;
	
	bottomView.backgroundColor = [UIColor cz_colorWithHex:0xefefef];
	
	creditsImgView.image = [UIImage imageNamed:@"v2_empty_pointsDeatil"];
	
	[goShoppintBtn setTitle:@"去购物" forState:UIControlStateNormal];
	[goShoppintBtn setTitleColor:[UIColor cz_colorWithHex:0xa4a4a4] forState:UIControlStateNormal];
	[goShoppintBtn addTarget:self action:@selector(goShoppingBtnAction) forControlEvents:UIControlEventTouchUpInside];
	
	goShoppintBtn.layer.borderColor = [[UIColor cz_colorWithHex:0xe8e8e8] CGColor];
	goShoppintBtn.layer.borderWidth = 1.1f;
	goShoppintBtn.layer.cornerRadius = 5;
	goShoppintBtn.layer.masksToBounds = YES;
	
	[self.view addSubview:circleView];
	[self.view addSubview:bottomView];
	[self.view addSubview:creditsImgView];
	[self.view addSubview:infoLabel];
	[self.view addSubview:goShoppintBtn];
	
	
//	[circleView mas_makeConstraints:^(MASConstraintMaker *make) {
//		make.top.equalTo(self.view).offset(64);
//		make.leading.equalTo(self.view);
//		make.size.mas_equalTo(CGSizeMake(kSCREENWIDTH, 183));
//	}];
	
	[bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.top.equalTo(circleView.mas_bottom);;
		make.left.bottom.right.offset(0);
	}];
	
	[creditsImgView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.centerX.equalTo(self.view);
		make.bottom.offset(-279);
	}];
	
	[infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.centerX.equalTo(creditsImgView);
		make.top.equalTo(creditsImgView.mas_bottom).offset(22);
	}];
	
	[goShoppintBtn mas_makeConstraints:^(MASConstraintMaker *make) {
		make.centerX.equalTo(infoLabel);
		make.top.equalTo(infoLabel.mas_bottom).offset(36);
		make.width.equalTo(@144);
		make.height.equalTo(@29);
	}];
	
	AXFWhiteNavView *whiteNavView = [[AXFWhiteNavView alloc] init];
	
	[whiteNavView setTitleName:@"积分" andFunctionName:nil];
	
	whiteNavView.delegate = self;
	
	[self.view addSubview:whiteNavView];
	
	[whiteNavView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.right.top.offset(0);
		make.height.mas_equalTo(kNAVBARH + 20);
	}];
}

- (void)backToViewController {
	[self.navigationController popViewControllerAnimated:YES];
}

- (void)goShoppingBtnAction {
	[[NSNotificationCenter defaultCenter] postNotificationName:@"pushToHome" object:nil];
	[self.navigationController popViewControllerAnimated:NO];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
